import request from '@/utils/request'
//1.查询所有学生[servlet版本]
// export function findAll() {
//   return request({
//     url: '/student?cmd=list',
//     method: 'get'
//   })
// }

//2.查询所有学生[springmvc版本]
export function findAll() {
  return request({
    url: '/student/list',
    method: 'get'
  })
}
//2.分页带条件查询
export function search(page,pageSize,studentSearch) {
  return request({
    url: `/student/search?page=${page}&pageSize=${pageSize}`,
    method: 'post',
    data:studentSearch
  })
}
//3.保存学生
export function edit(url,stud) {
  return request({
    url:url,
    method:'post',
    data:stud
  })
}
//4.删除学生
export function del(sid) {
  return request({
    url:`/student/del?sid=${sid}`,
    method:'get'
  })
}
//5. 文件上传
export function uploadFile(data,headers) {
  return request({
    url: '/upload',
    method: 'post',
    data:data,
    headers:headers
  })
}
